package com.jdz.controller;

import com.jdz.tools.ControlUtil;
import org.springframework.boot.SpringBootVersion;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;

import static com.jdz.tools.ControlUtil.*;

@Controller
public class DataUploadController {
    @RequestMapping("/uploadNoise")
    @ResponseBody
    public String uploadNoise(@RequestParam("file") MultipartFile file) {
        System.out.println("上传噪声数据:"+file.getOriginalFilename());
        System.out.println("ContentType:"+file.getContentType());
        return ControlUtil.uploadFile(file,NOISE_TYPE);

    }
    @RequestMapping("/uploadFly")
    @ResponseBody
    public String uploadFly ( @RequestParam("file") MultipartFile file ) {
        System.out.println("上传飞参数据:"+file.getOriginalFilename());
        return ControlUtil.uploadFile(file,FLY_TYPE);
    }
}
